
#ifndef wu_ANIMATAXMLMANAGER_H
#define wu_ANIMATAXMLMANAGER_H

#pragma once
#include "wuAnimataXML.h"
#include "wuBase2dManager.h"
#include "wuSkin.h"

#define ANIMATAXML_MAX 6

class wuAnimataXMLManager : public wuBase2dManager
{
    public:
        wuAnimataXMLManager();
        ~wuAnimataXMLManager();

	    void setup(ofxBox2d * _box2d, string _XMLfilename, int _vw, int _vh);
		bool action(ofImage *currImg, ofImage *bgImg, int action, int x_offset);
		void update();
		void addBitxo(ofImage *_skin, ofRectangle rect, vector <ofPoint> * _pts);
        void draw(bool pinta_bg=false, int offX=0);
        void drawSelected(bool pinta_bg=false, int offX=0);
        void clear(void);
		void OrderSkins();
		void touch(int _x,int _y, int forceX=300, int forceY=0);
		bool drag(int _x, int _y);
		void dragOff();

        void setScale(float _scale);
        void setContourAmount(int _amount);
        void setPosition(int _x, int _y);

		// box2d
//		vector <wuAnimataXML> animatas;
		wuAnimataXML animatas[ANIMATAXML_MAX];

		// skins of pieces
        vector <wuSkin> skins;

		wuSkin skinInit;
		ofRectangle rectInit;

		int num_elem;
		string XMLfilename;

		int ongoing_action;
		bool bPintaCambiazo;
};
#endif

